package com.qfedu.meidijiaju.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qfedu.meidijiaju.common.ResponseData;
import com.qfedu.meidijiaju.entity.StShopping;
import com.qfedu.meidijiaju.mapper.StShoppingMapper;
import com.qfedu.meidijiaju.service.StShoppingService;

import org.springframework.stereotype.Service;


import javax.annotation.Resource;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author meidimeiju
 * @since 2022-10-05
 */
@Service
public class StShoppingServiceImpl extends ServiceImpl<StShoppingMapper, StShopping> implements StShoppingService {

    @Resource
    private StShoppingMapper stShoppingMapper;

    @Override
    public ResponseData<List<StShopping>> findStShoppingByNameLike(String name) {


        ResponseData<List<StShopping>> responseData = new ResponseData<>();


        List<StShopping> list = stShoppingMapper.findStShoppingByNameLike ("%" + name + "%");

        if (list != null ) {

            responseData.setCode(200);

            responseData.setData(list);

        } else {
            responseData.setCode(400);

            responseData.setMsg("无数据");
        }


        return responseData;
    }



}
